//
//  CHWXJLDetailCell.m
//  CarFile
//
//  Created by 陈浩 on 2017/4/11.
//  Copyright © 2017年 陈浩. All rights reserved.
//

#import "CHWXJLDetailCell.h"
@interface CHWXJLDetailCell()
@property (nonatomic ,strong) UILabel *nameResutlLabel;
@property (nonatomic ,strong) UILabel *hourResultLabel;

@end
@implementation CHWXJLDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}



+(instancetype)cellForTableView:(UITableView *)tableView{
    static NSString *ID = @"CHWXJLDetailCell";
    CHWXJLDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[CHWXJLDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:ID];
    }
    return cell;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
//        self.textLabel.font = [UIFont systemFontOfSize:14];
//        self.detailTextLabel.font = [UIFont systemFontOfSize:14];
        self.backgroundColor = [UIColor colorWithHexString:@"eeeef0" alpha:1];
        
        
        [self setupUI];
    }
    return self;
    
}

-(void)setupUI{
    
    UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 100, 40)];
    nameLabel.text = @"维修项目名称";
    nameLabel.font = [UIFont systemFontOfSize:14];
    [self addSubview:nameLabel];
    
    UILabel *nameResutlLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(nameLabel.frame), 0, UIScreenW - 120, 40)];
    nameResutlLabel.textAlignment = NSTextAlignmentRight;
    nameResutlLabel.font = [UIFont systemFontOfSize:14];
    nameResutlLabel.numberOfLines = 0;
    [self addSubview:nameResutlLabel];
    self.nameResutlLabel = nameResutlLabel;
    
    UILabel *hourLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 40, 100, 40)];
    hourLabel.text = @"维修项目工时";
    hourLabel.font = [UIFont systemFontOfSize:14];
    [self addSubview:hourLabel];
    
    UILabel *hourResultLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(nameLabel.frame), 40, nameResutlLabel.w, 40)];
    hourResultLabel.numberOfLines = 0;
    hourResultLabel.textAlignment = NSTextAlignmentRight;
    hourResultLabel.font = [UIFont systemFontOfSize:14];
    [self addSubview:hourResultLabel];
    self.hourResultLabel = hourResultLabel;
    
}

- (void)setModel:(ProjectModel *)model{
    _model = model;
    
    self.nameResutlLabel.text = model.repairname;
    self.hourResultLabel.text = model.repairhours;
    
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
